package cn.sh.library.gmwx;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
 * @author CM
 */
@SpringBootApplication
@MapperScan("cn.sh.library.gmwx.mapper")

// jar包配置，无需tomcat启动
/*public class GmwxApplication {*/

// war包配置，使用Tomcat启动
public class GmwxApplication extends SpringBootServletInitializer {
	
	// war包配置，重写configure方法
	@Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(GmwxApplication.class);
    }
	//使用Tomcat启动war包
	public static void main(String[] args) {
        new SpringApplicationBuilder(GmwxApplication.class).web(true).run(args);
    }
	 
	/*
	 // jar包启动
	public static void main(String[] args) {
		SpringApplication.run(GmwxApplication.class, args);
	}
	*/
	
}
